<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
</head>
<body>

<!-- 页头 -->
<header th:fragment="header">
    <nav class="navbar navbar-expand-lg navbar-light bg-light">
        <div class="container">
            <a class="navbar-brand" href="/">校园食堂点评系统</a>
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav"
                    aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav mr-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="/">首页</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/canteen">食堂</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/store">档口</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/dish">菜品</a>
                    </li>
                </ul>
                <div class="navbar-nav" th:if="${session.user == null}">
                    <a class="nav-link" href="/login">登录</a>
                    <a class="nav-link" href="/register">注册</a>
                </div>
                <div class="navbar-nav" th:if="${session.user != null}">
                    <span class="nav-link" th:text="${session.user.userName}">用户名</span>
                    <a class="nav-link" href="/logout">退出</a>
                </div>
            </div>
        </div>
    </nav>
</header>

<!-- 页脚 -->
<footer th:fragment="footer" class="footer">
    <div class="container">
        <div class="text-center py-3">
            <p>© 2024 校园食堂点评系统. All rights reserved.</p>
        </div>
    </div>
    <!-- Bootstrap JS -->
    <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</footer>

</body>
</html> 